﻿app.controller('OrderDetailCtrl', ['$scope', '$http','httpPlus', '$filter','utils', '$stateParams',function ($scope, $http,httpPlus, $filter,utils,$stateParams) {
    utils.setTitle('订单详情');
    var guid = $stateParams.billid;
    $scope.orderDetails = {
        BillHead:{
            BillDateTime:'2018/07/10 12:00',
            ShopName:'老班长餐饮'
        },
        BillItems:[{
            IsSetMeal:true,
            ItemCount:1,
            ItemName:'套餐1',
            ItemPrice:100,
            SetMealItems:_.map(_.range(1,5),function(val){
                return{
                    ItemCount:val,
                    ItemName:'明细项目'+val,
                }
        })
        },{
            IsSetMeal:false,
            ItemCount:4,
            ItemName:'原味汤粉',
            ItemPrice:500,
        }]
    };
    httpPlus
        .MMB2RRRApi('BillMangerBLL/GetMyBillDetail',{
            _billGuid:guid
        },'wechat')
        .then(function (data) {
            console.log(data);
            $scope.orderDetails.BillItems = data.BillItems;
        });
}]);